<template>
	<view class="page">
		<homeTop></homeTop>
		<view class="mt">
			<homeChart></homeChart>
		</view>
		<view class="mt">
			<homeAct></homeAct>
		</view>
		<!-- <button class="uni-white uni-success-bg" @click="getImg">
			login
		</button> -->
	</view>
</template>

<script>
	import homeTop from "./components/home-top.vue";
	import homeChart from "./components/home-chart.vue";
	import homeAct from "./components/home-act.vue";
	
	export default {
		components: {
			homeTop,
			homeChart,
			homeAct
		},
		data() {
			return {};
		},
		mounted() {
			// uni.login({
			// 	success(e) {
			// 		console.log(e)
			// 	}
			// })
		},
		methods: {
			getUserInfo() {
				uni.getUserProfile({
					desc: '用于完善会员资料', // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
					success: (res) => {
						console.log(res)
					}
				})
			},
			
			getImg(){
				uni.chooseImage({
				  success (res) {
				    const tempFilePaths = res.tempFilePaths;
					
					// console.log(res)
					// console.log('数据',tempFilePaths['result'])
				    // wx.uploadFile({
				    //   url: 'https://example.weixin.qq.com/upload', //仅为示例，非真实的接口地址
				    //   filePath: tempFilePaths[0],
				    //   name: 'file',
				    //   formData: {
				    //     'user': 'test'
				    //   },
				    //   success (res){
				    //     const data = res.data
				    //     //do something
				    //   }
				    // })
				  }
				})
			},
			
		
		},
	};
</script>

<style lang="scss" scoped>
	.page {
		width: 699.28rpx;
		margin: auto;
		padding-top: 30rpx;
		padding-bottom: 30rpx;

		.mt {
			margin-top: 40rpx;
		}
	}
</style>